package com.mew.lobby.provide;

import com.mew.common.entity.user.Profile;
import com.mew.common.entity.user.User;
import com.mew.common.rest.user.EnterInfoResponse;
import com.mew.common.rest.user.UserDetailedInfoResponseMessage;
import com.mew.common.rest.user.VipInfoMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient(value = "mew-kernel-user")
public interface UserFeignService {
    @PostMapping("/user/update")
    @ResponseBody
    int updateUser(@RequestBody User user);

    @PostMapping("/user/update_nickname")
    @ResponseBody
    int updateNickname(@RequestParam("uid")long uid,@RequestParam("telephone") String nickname);

    @PostMapping("/user/update_account")
    @ResponseBody
    int updateAccount(@RequestBody User user);

    @PostMapping("/user/updateprofile")
    @ResponseBody
    int updateProfile(@RequestBody Profile profile);

    @PostMapping("/user/bind_telephone")
    @ResponseBody
    int bindTelephone(@RequestParam("uid")long uid,@RequestParam("telephone") String telephone);
    /**
     * 获取详细信息 通过uid
     */
    @PostMapping("/user/detailed_by_uid")
    @ResponseBody
    UserDetailedInfoResponseMessage getDetailedInfoByUid(@RequestParam("uid")long uid,@RequestParam("qid") long qid);

    /**
     * 获取详细信息 通过gid
     */
    @PostMapping("/user/detailed_by_gid")
    @ResponseBody
    UserDetailedInfoResponseMessage getDetailedInfoByGid(@RequestParam("uid")long uid,@RequestParam("gid")String gid);

    @GetMapping("/user/vip/{uid}")
    @ResponseBody
    VipInfoMessage vip(@RequestParam("uid")long uid);

    @GetMapping("/user/guide/{uid}/{t}")
    @ResponseBody
    Integer guide(@PathVariable("uid")long uid, @PathVariable("t")int t);

    /**
     * 修改金币
     */
    @PostMapping("/profile/addgold")
    @ResponseBody
    Profile addGold(@RequestParam("userId")long userId, @RequestParam("gold")long gold, @RequestParam("type")int type);
}
